<template>
	<view class="page">
		<view class="title">
			{{info.noticeTitle}}
		</view>
		<view class="time">{{info.createTime}}</view>
		<view class="content">
		<rich-text :nodes="info.noticeContent"></rich-text>
		</view>
	</view>
</template>

<script>
	import {noticelistAPI} from "@/api/appointment.js"
	export default {
		data() {
			return {
				type:'',
				sourceType:0,
				info:{}
			}
		},
		onLoad(option) {
			// 1 接单须知 3 积分规则  4隐私协议
			if(option.type){
				this.type=option.type
				let title='接单须知'
				if (this.type==2) {
					title='积分规则'
				}
				if (this.type==4) {
					title='隐私协议'
				}
				uni.setNavigationBarTitle({
					title:title
				})
				
				this.getinfo()
			}
		},
		methods: {
			getinfo(){
				noticelistAPI({pageNo:1,pageSize:1,sourceType:this.sourceType,type:this.type}).then(res=>{
					this.info=res.data[0]
				})
			}
		}
	}
</script>

<style>
.page{
	padding: 20rpx;
}
.title{
	font-size: 32rpx;
	font-weight: bold;
	text-align: center;
	line-height: 45rpx;
}
.time{
	color: #7C8191;
	font-size: 22rpx;
	text-align: center;
	margin-top: 10rpx;
}
.content{
	line-height: 40rpx;
	margin-top: 20rpx;
	
}
image{
		width: 100% !important;
	}
</style>
